import { getAction, postQueryAction, postAction, postQueryOtherAction, getOtherAction, deleteAction, putAction, httpAction } from '@/api/manage'
// import { param } from 'jquery'
// import Vue from 'vue'

// 授权登录
const author = params => getOtherAction('/yw_qyapi/ywQyapi/getOpen_id', params)
//获取小程序的access_token
const getAccessToken = params => getOtherAction('/yw_qyapi/ywQyapi/getAccessToken', params)
// 获取所有项目
const getAllProject = params => getAction('/yw_project/ywProject/listByUserId', params)
//获取Ticket
const getTicket = params => postQueryOtherAction('/wecom/getJSApiTicket', params)

//字典标签专用（通过code获取字典数组）
const getDicts = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);


//外勤签到-列表
const scheduleList = params => getAction('/yw_qyapi/ywQyapi/scheduleList', params)
//外勤签到-签到
const doSign = params => postQueryAction('/yw_qyapi/ywQyapi/doSign', params)
//外勤签到-文件上传
const uploadFile = params => postAction('/yw_tz/ywTz/upload', params)
//外勤签到-汇报保存
const doReport = params => postAction('/yw_qyapi/ywQyapi/doReport', params)

//商机信息-列表
const opportunityList = params => getAction('/yw_opportunity/ywOpportunity/opportunityList', params)
//商机信息-删除
const opportunityDelete = params => deleteAction('/yw_opportunity/ywOpportunity/delete', params)
//商机信息-新增
const opportunityAdd = params => postAction('/yw_opportunity/ywOpportunity/add', params)
//商机信息-编辑
const opportunityEdit = params => putAction('/yw_opportunity/ywOpportunity/edit', params)
//商机信息-详情
const opportunityDetail = params => getAction('/yw_opportunity/ywOpportunity/queryById', params)
//商机信息-联系人详情
const serOpportunityContact = params => getAction('/yw_opportunity/ywOpportunity/serOpportunityContact', params)
//商机信息-跟进记录详情
const serOpportunityRecord = params => getAction('/yw_opportunity/ywOpportunity/serOpportunityRecord', params)
//商机信息-审核
const opportunityDoRepeat = params => postQueryAction('/yw_opportunity/ywOpportunity/doRepeat', params)
//商机信息-反审核
const opportunityDoUnRepeat = params => postQueryAction('/yw_opportunity/ywOpportunity/doUnRepeat', params)
//商机信息-选择商机阶段信息
const businessList = params => getAction('/yw_business/ywBusiness/list', params)
//商机信息-选择商机客户
const customerList = params => getAction('/yw_customer/ywCustomer/customerList', params)
//商机管理-商机记录阶段选择
const sernodeList = params => getAction('/yw_opportunity/ywOpportunity/sernodeList', params)
//商机信息-跟进记录保存
const addOpportunityRecord = params => postAction('/yw_opportunity/ywOpportunity/addOpportunityRecord', params)

//代办事项-列表
const ywTaskList = params => getAction('/yw_task/ywTask/ywTaskList', params)
//代办事项-删除
const ywTaskListDelete = params => deleteAction('/yw_task/ywTask/delete', params)
//代办事项-新增
const ywTaskListAdd = params => postAction('/yw_task/ywTask/add', params)
//代办事项-编辑
const ywTaskListEdit = params => putAction('/yw_task/ywTask/edit', params)
//代办事项-详情
const ywTaskListDetail = params => getAction('/yw_task/ywTask/queryById', params)
//代办事项-联系人详情
const queryYwTaskEntryByMainId = params => getAction('/yw_task/ywTask/queryYwTaskEntryByMainId', params)

//外勤日历-日历列表
const calendarList = params => getAction('/yw_qyapi/ywQyapi/calendarList', params)
//外勤日历-日历详情
const serScheduleDetail = params => getAction('/yw_qyapi/ywQyapi/serScheduleDetail', params)
//外勤日历-待办事项
const serTaskDetail = params => getAction('/yw_qyapi/ywQyapi/serTaskDetail', params)

//我的客户-删除
const deleteCustomer = params => deleteAction('/yw_customer/ywCustomer/delete', params)
//我的客户-审核
const doCheckCustomer = params => postQueryAction('/yw_customer/ywCustomer/doCheck', params)
//我的客户-反审核
const doUnCheckCustomer = params => postQueryAction('/yw_customer/ywCustomer/doUnCheck', params)
//我的客户-关注
const doFollowCustomer = params => postQueryAction('/yw_customer/ywCustomer/doFollow', params)
//我的客户-取消关注
const doUnFollowCustomer = params => postQueryAction('/yw_customer/ywCustomer/doUnFollow', params)
//我的客户-新增
const addCustomer = params => postAction('/yw_customer/ywCustomer/add', params)
//我的客户-编辑
const editCustomer = params => putAction('/yw_customer/ywCustomer/edit', params)
//我的客户-详情
const queryByIdCustomer = params => getAction('/yw_customer/ywCustomer/queryById', params)
//我的客户-获取名称
const qichachaSearch = params => getAction('/yw_customer/ywCustomer/qichachaSearch', params)
//我的客户-共享列表
const shareCustomer = params => getAction('/yw_customer/ywCustomer/userList', params)
//我的客户-共享
const doShareCustomer = params => postQueryAction('/yw_customer/ywCustomer/doShare', params)
//我的客户-商机
const serOpportunity = params => getAction('/yw_customer/ywCustomer/serOpportunity', params)
//我的客户-日程
const searchYwScheduleList = params => getAction('/yw_schedule/ywSchedule/ywScheduleList', params)
//我的客户-联系人
const serCustomerContact = params => getAction('/yw_customer/ywCustomer/serOpportunityContact', params)

export {
  serCustomerContact,
  searchYwScheduleList,
  serOpportunity,
  doShareCustomer,
  shareCustomer,
  qichachaSearch,
  queryByIdCustomer,
  editCustomer,
  addCustomer,
  doUnFollowCustomer,
  doFollowCustomer,
  doUnCheckCustomer,
  doCheckCustomer,
  deleteCustomer,
  queryYwTaskEntryByMainId,
  ywTaskListDetail,
  ywTaskListEdit,
  ywTaskListAdd,
  ywTaskListDelete,
  ywTaskList,
  serTaskDetail,
  serScheduleDetail,
  calendarList,
  addOpportunityRecord,
  serOpportunityRecord,
  sernodeList,
  customerList,
  businessList,
  serOpportunityContact,
  opportunityDetail,
  getDicts,
  opportunityDoUnRepeat,
  opportunityDoRepeat,
  opportunityEdit,
  opportunityAdd,
  opportunityDelete,
  opportunityList,
  doReport,
  uploadFile,
  doSign,
  scheduleList,
  getAccessToken,
  getTicket,
  author,
  getAllProject,
}
